<!--
 * @Author: yaojian66 1327629137@qq.com
 * @Date: 2022-06-29 16:21:57
 * @LastEditors: yaojian66 1327629137@qq.com
 * @LastEditTime: 2022-06-29 16:34:07
 * @FilePath: \geyao\第九十六题 判断质数.html
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>判断质数</title>
</head>
<body>
  <!-- 请补全JavaScript代码，要求在Number对象的原型对象上添加"_isPrime"函数，该函数判断调用的对象是否为一个质数，是则返回true，否则返回false。 -->
  <script>
     	Number.prototype._isPrime = function () {
    let number = this.valueOf()
    if(number < 2) return false
    for(let i=2 ; i<=number ; i++) {
        if(i === number) return true
        if(number%i === 0) return false
        if(number%i !== 0) continue
    }
}
  </script>
</body>